<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/include/taglib.jsp"%>
<%@ page import="java.sql.*"%>
				<%
						String driverName = "com.mysql.jdbc.Driver"; //Mysql数据库连接
						String userName = "root";
						String psw = "123456"; //本行和上一行是数据库的登录名和密码
						String dbName = "test1"; //数据库名字
						String url = "jdbc:mysql://localhost:3306/test1?serverTimezone=UTC";
						Class.forName("com.mysql.jdbc.Driver");
						Connection conn = DriverManager.getConnection(url, userName, psw);
						Statement stam = conn.createStatement(); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="${ctx}/layui/css/layui.css">
<script>
	var ctx = "${ctx}";
</script>
</head>
<body>
	<form class="layui-form" style="width: 80%;" id = "arf">
		<!-- 管理员id -->
		<input type="hidden" name="color_id" value="${color.color_id }"
			id="id" />
		<div class="layui-form-item">
			<label class="layui-form-label">分类名称</label>
			<div class="layui-input-block">
				<input type="text" id="product_color" class="layui-input"
					name="product_color" value="${color.product_color }">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">商品ID</label>
			<div class="layui-input-block">
				<%-- <input type="text" id="product_id" class="layui-input"
					name="product_id"
					value="${color.product_id }"> --%>
					<select name="product_id" id="product_id"
					class="layui-input search_input" lay-verify="required"
					lay-search="">
					<option value="${color.product_id }">${color.product_name }</option>
					<%
						
						ResultSet rs = stam.executeQuery("SELECT product.product_name,product.product_id FROM product");

						while (rs.next()) //循环输出数据
						{
							out.print("<option value=" + rs.getInt("product_id") + ">" + rs.getString("product_name") + "</option>");
						}
					%>
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">价格</label>
			<div class="layui-input-block">
				<input type="text" id="color_price" class="layui-input"
					name="color_price" value="${color.color_price }">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">产品库存</label>
			<div class="layui-input-block">
				<input type="text" id="color_inventory" class="layui-input"
					name="color_inventory" value="${color.color_inventory }">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">规格图片</label>
			<div class="layui-input-block">
				<input type="text" id="color_img" class="layui-input"
					name="color_img" value="${color.color_img }">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">折扣价格</label>
			<div class="layui-input-block">
				<input type="text" id=color_discount class="layui-input"
					name="color_discount" value="${color.color_discount }">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">产品尺寸</label>
			<div class="layui-input-block">
				<input type="text" id="product_size" class="layui-input"
					name="product_size" value="${color.product_size }">
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn" lay-submit="" lay-filter="updateColor">立即保存</button>
			</div>
		</div>
	</form>
	<script type="text/javascript" src="${ctx }/layui/layui.js"></script>
	<script type="text/javascript" src="${ctx }/js/color/editColor.js"></script>
</body>
</html>